<!doctype html>
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" type="text/css" href="/resource/admin/css/admin.css" media="all" />
<link rel="stylesheet" type="text/css" href="/resource/static/h-ui/css/H-ui.min.css" />
<link rel="stylesheet" type="text/css" href="/resource/static/h-ui.admin/css/H-ui.admin.css" />
<link rel="stylesheet" type="text/css" href="/resource/lib/Hui-iconfont/1.0.9/iconfont.css" />
<script type="text/javascript" src="/resource/common/js/jquery-1.12.3.min.js"></script>
<script type="text/javascript" src="/resource/admin/plugs/layer/layer.js"></script>
<script type="text/javascript" src="/resource/admin/plugs/laydate/laydate.js"></script>
<script src="/resource/admin/js/initialization.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript" src="/resource/admin/js/team.js"></script>
<title>团队订单</title>
<style type="text/css">
.form-table th, .form-table td {
	border: 1px #eee solid;
	height: 30px;
	padding: 0 10px;
}
.form-table thead th {
	color: #555;
	font-weight: 600;
}
.form-table td:first-child {
	font-weight: 600;
	color: #666;
}
input,select,textarea {
	background-color: #fff;
	border-radius: 3px;
	border: 1px #ddd solid;
	height: 36px;
	max-width: 250px;
	padding: 0 10px;
}
.form-table td textarea {
	background-color: #fff;
	border-radius: 3px;
	border: 1px #ddd solid;
	height: 80px;
	min-width: 250px;
	padding: 0 10px;
}
.form-table td button,.form-table th button,.button {
	background: #1e9fff;
	height: 36px;
	padding: 5px 15px;
	border-radius: 4px;
	border: 0;
	color: #fff;
	font-weight: 600;
	font-size: 14px;
}
.form-table td span {
	margin-left: 10px;
	color: red;
}
.form-table tbody tr:hover {
	background-color: #f9f9f9;
}
</style>
</head>
<body>
	<nav class="breadcrumb">
		<i class="Hui-iconfont">&#xe67f;</i>首页
		<span class="c-gray en">&gt;</span>团队订单
		<a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" >
			<i class="Hui-iconfont">&#xe68f;</i>
		</a>
	</nav>
	<div style="padding: 30px">
		<form id="searchform"  action="/admin/team/order" method="get">
			用户
			<input type="text" name="username" value="{$where.username ?? ''}">&nbsp;&nbsp;
			商户
			<input type="text" name="merchant" value="{$where.merchant ?? ''}">&nbsp;&nbsp;
			订单号
			<input type="text" name="order1" value="{$where.order1 ?? ''}">&nbsp;&nbsp;
			商户订单号
			<input type="text" name="order2" value="{$where.order2 ?? ''}">&nbsp;&nbsp;
			<br><br>
			订单状态
			<select name="state">
				{foreach $orderStates as $key=>$value}
				<option value="{$key}"{if isset($where.state) and $where.state eq $key} selected="true"{/if}>{$value}</option>
				{/foreach}
			</select>&nbsp;&nbsp;
			支付方式
			<select name="payType">
				<option value="">全部</option>
				{foreach $payway as $key=>$value}
				{if $value}
				<option value="{$key}"{if isset($where.payType) and $where.payType eq $key} selected="true"{/if}>{$value}</option>
				{/if}
				{/foreach}
			</select>&nbsp;&nbsp;
			订单时间
			<input type="text" name="datetime" value="{$where.datetime ?? ''}" style="width:300px;" readonly>&nbsp;&nbsp;
			<input type="submit" value="搜索" class="button"/>
		</form>
		<div style="float:right; display:block; margin:20px 2px;">
		</div>
		<table width="100%" class="form-table">
			<thead>
				<tr>
					<th>订单号</th>
					<th>商户订单号</th>
					<th>商户</th>
					<th>抢单用户</th>
					<th>支付方式</th>
					<th>订单金额</th>
					<th>建单时间</th>
					<th>状态</th>
					<th>操作</th>
				</tr>
			</thead>
			<tbody>
				{if $data}
				{foreach $data as $key=>$value}
				<tr>
					<td>{$value.orderid}</td>
					<td>{$value.jorderid}</td>
					<td>{$value.mName}</td>
					<td>{$value.uName}</td>
					<td>
						{switch $value.payway}
							{case AliPay}支付宝{/case}
							{case WechatPay}微信{/case}
							{default /}银行
						{/switch}
					</td>
					<td>{$value.oamount}</td>
					<td>{$value.ordertimes|match_msecdate|date="Y-m-d H:i:s"}</td>
					<td style="color:#{$value.statusColor};">{$value.statusStr}</td>
					<td>
						{if $value.status eq 2 and $value.callstatus eq 2}
						<button type="button" class="button" onClick="pubTips(this,'callBack',{$value.id},'回调')">回调</button>
						{/if}
						{if $value.status eq 4 and $value.bitype eq 2 and $value.uid neq ''}
						<button type="button" class="button" onClick="repairorder({$value.id},'{$value.orderid}')">补单</button>
						{/if}
					</td>
				</tr>
				{/foreach}
				{else /}
				<tr>
					<td colspan="9" style="text-align: center;font-weight: normal;color: #999">暂无数据</td>
				</tr>
				{/if}
			</tbody>
		</table>
		<div class="page">{$page|raw}</div>
	</div>
</body>
</html>